<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">菜单信息</h3>
    </div>
     <div class="well">
        <div class="pagination">
            <button type="button" class="btn btn-primary" id="add_item">
                添加
            </button>
            <button type="button" class="btn btn-primary" id="remove_items">
                删除
            </button>
        </div>
    </div>
    <div class="panel-body">
        <table class="table table-condensed table-striped">
            <thead>
            <tr>
                <th><input type="checkbox" class="rows_check" /> </th>
                <th>编号</th>
                <th>名称</th>
                <th>显示名称</th>
                <th>创建时间</th>
                <th>创建人</th>
                <th>备注</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <?php if(isset($menuList)):?>
                <?php foreach($menuList as $key=>$list):?>
                    <tr>
                        <td><input type="checkbox" class="row_check" data-id="<?php echo $list['id'] ?>" /></td>
                        <td><?php echo $key+1 ?></td>
                        <td><?php echo $list['name'] ?></td>
                        <td><?php echo $list['caption'] ?></td>
                        <td><?php echo $list['createdon'] ?></td>
                        <td><?php echo $list['createdby'] ?></td>
                        <td><?php echo $list['remark'] ?></td>
                        <td>
                            <button type="button" class="btn btn-primary update_item"  
                            data-id="<?php echo $list['id'] ?>">
                                修改
                            </button>
                            <button type="button" class="btn btn-primary remove_item"  
                            data-id="<?php echo $list['id'] ?>">
                                删除
                            </button>
                        </td>
                    </tr>
                <?php endforeach; ?>
            <?php endif;?>
            </tbody>
        </table>
    </div>
    <div class="modal fade" id="list_modal" tabindex="-1" role="dialog" model="Menu" 
        aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close"
                            data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">
                        菜单信息
                    </h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" role="form" id="list_form" name="list_form">
                        <div class="form-group">
                            <input type="hidden" class="form-control" id="model_id" name="model_id" />
                        </div>
                        <div class="form-group">
                            <label for="username" class="col-sm-2 control-label">名称</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="name" name="name"
                                       placeholder="请输入名称">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="username" class="col-sm-2 control-label">显示名称</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="caption" name="caption"
                                       placeholder="请输入显示名称">
                            </div>
                        </div>
                         <div class="form-group">
                            <label for="username" class="col-sm-2 control-label">地址</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="url" name="url"
                                       placeholder="请输入地址">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="username" class="col-sm-2 control-label">产品分类</label>
                            <div class="col-sm-10">
                                <select id="model_pid" class="form-control" name="model_pid">
                                    <?php if(isset($assortList)):?>
                                        <?php foreach($assortList as $key=>$alist):?>
                                            <option value="<?php echo $alist['id'] ?>"><?php echo $alist['caption'] ?></option>
                                        <?php endforeach;?>
                                    <?php endif;?>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="remark" class="col-sm-2 control-label">备注</label>
                            <div class="col-sm-10">
                                <textarea class="form-control" rows="2" id="remark" name="remark"></textarea>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default"
                            data-dismiss="modal">关闭
                    </button>
                    <button type="button" id="saveForm" class="btn btn-primary">
                        保存
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>
